]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
NetworkMenu: fix number of visible networks
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 19 Nov 2011 18:01:24 +0000 (19:01 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 7 Dec 2011 14:35:19 +0000 (15:35 +0100)
When placing networks in _createSection, we were taking in
consideration that _activeNetwork is always first, by adding 1,
but then kept this offset also for networks following it (normally,
all of them, since _activeNetwork is also the most recently used),
that instead should not be affected by the movement.
This resulted in the menu showing 4 networks + More... instead of
5.

https://bugzilla.gnome.org/show_bug.cgi?id=664124

js/ui/status/network.js

index a68bd8c5fa63e30ce202cc3e431b5afe8a403bdd..fa2b8dfab1fff328fb6eea753336210b33394787 100644 (file)
@@ -1524,8 +1524,10 @@ const NMDeviceWireless = new Lang.Class({
 
         for(let j = 0; j < this._networks.length; j++) {
             let apObj = this._networks[j];
-            if (apObj == this._activeNetwork)
+            if (apObj == this._activeNetwork) {
+                activeOffset--;
                 continue;
+            }
 
             this._createNetworkItem(apObj, j + activeOffset);
         }